﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="clk_faliao.aspx.cs" Inherits="Default3" Title="材料发放" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">

        .style7
        {
            font-size: small;
            text-align: left;
        }
        .新建样式1
        {
            text-align: center;
        }
        .style8
        {
            font-size: small;
        }
        .style21
        {
            font-size: small;
        }
        .auto-style1 {
            color: #FF0000;
        }
        .auto-style2 {
            font-size: medium;
        }
        </style>
</head>
<body background="images/login-bg.jpg">
    <form id="form1" runat="server">
    <div style="text-align: center">
    
    <div class="style7">
    
        <span class="style7">当前位置：</span><asp:HyperLink ID="HyperLink1" runat="server" 
            CssClass="style7" NavigateUrl="~/index.aspx" style="color: #000000" 
            ToolTip="点击返回主页面">主页面</asp:HyperLink>
        <span class="style7">→ 材料发放</span><br class="style7" />
        <br /></div>
<div>
        <br />
        <br /><b>待发料计划单<br />
        <br />
        <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="c_id" 
        DataSourceID="SqlDataSource2" EmptyDataText="没有待发料的计划单" 
        EnableModelValidation="True" ForeColor="#333333" GridLines="None" 
        style="text-align: center; font-size: small" 
            onrowdatabound="GridView2_RowDataBound" PageSize="5" Font-Bold="False">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" HeaderText="删除" Visible="False" />
                <asp:TemplateField HeaderText="序号"></asp:TemplateField>
                <asp:BoundField DataField="c_id" HeaderText="编号" InsertVisible="False" 
                ReadOnly="True" SortExpression="c_id" />
                <asp:BoundField DataField="lei" HeaderText="类别" SortExpression="lei" />
                <asp:BoundField DataField="chejian" HeaderText="所属车间" 
                SortExpression="chejian" />
                <asp:BoundField DataField="banzu" HeaderText="班组" SortExpression="banzu" />
                <asp:BoundField DataField="nian" HeaderText="年" SortExpression="nian" />
                <asp:BoundField DataField="yue" HeaderText="月" SortExpression="yue" />
                <asp:BoundField DataField="addname" HeaderText="提报人" SortExpression="addname" />
                <asp:BoundField DataField="addtime" HeaderText="提报时间" 
                SortExpression="addtime" />
                <asp:BoundField DataField="chejianname" HeaderText="车间审批" 
                    SortExpression="chejianname" />
                <asp:BoundField DataField="chejiantime" HeaderText="车间审批时间" 
                    SortExpression="chejiantime" />
                <asp:BoundField DataField="duanname" HeaderText="段审批" 
                    SortExpression="duanname" />
                <asp:BoundField DataField="duantime" HeaderText="段审批时间" 
                    SortExpression="duantime" />
                                <asp:BoundField DataField="cailiaoname" HeaderText="材料科受理" 
                                    SortExpression="cailiaoname" >
                                <ItemStyle Width="40px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="cailiaotime" HeaderText="受理时间" 
                                    SortExpression="cailiaotime" >
                                <ItemStyle Width="65px" />
                                </asp:BoundField>
                <asp:BoundField DataField="zt" HeaderText="zt" SortExpression="zt" />
                <asp:BoundField DataField="liezhi" HeaderText="列支情况" 
                    SortExpression="liezhi" />
                <asp:HyperLinkField DataNavigateUrlFields="c_id" 
                DataNavigateUrlFormatString="clk_faliao.aspx?id={0}" HeaderText="材料发放" 
                Text="材料发放" Visible="False" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>" 
            DeleteCommand="DELETE FROM [cailiaoguanli] WHERE [c_id] = @c_id" 
            InsertCommand="INSERT INTO [cailiaoguanli] ([lei], [chejian], [banzu], [nian], [yue], [addname], [addtime], [addip], [chejianname], [chejiantime], [chejianip], [duanname], [duantime], [duanip], [cailiaoname], [cailiaotime], [cailiaoip], [lingdaoname], [lingdaotime], [lingdaoip], [zt]) VALUES (@lei, @chejian, @banzu, @nian, @yue, @addname, @addtime, @addip, @chejianname, @chejiantime, @chejianip, @duanname, @duantime, @duanip, @cailiaoname, @cailiaotime, @cailiaoip, @lingdaoname, @lingdaotime, @lingdaoip, @zt)" 
            SelectCommand="SELECT     c_id, lei, chejian, banzu, nian, yue, addname, addtime, addip, chejianname, chejiantime, chejianip, duanname, duantime, duanip, cailiaoname, 
                      cailiaotime, cailiaoip, lingdaoname, lingdaotime, lingdaoip, zt, liezhi
FROM         cailiaoguanli
WHERE     (c_id = @c_id)" 
            
            
            
            
            UpdateCommand="UPDATE [cailiaoguanli] SET [lei] = @lei, [chejian] = @chejian, [banzu] = @banzu, [nian] = @nian, [yue] = @yue, [addname] = @addname, [addtime] = @addtime, [addip] = @addip, [chejianname] = @chejianname, [chejiantime] = @chejiantime, [chejianip] = @chejianip, [duanname] = @duanname, [duantime] = @duantime, [duanip] = @duanip, [cailiaoname] = @cailiaoname, [cailiaotime] = @cailiaotime, [cailiaoip] = @cailiaoip, [lingdaoname] = @lingdaoname, [lingdaotime] = @lingdaotime, [lingdaoip] = @lingdaoip, [zt] = @zt WHERE [c_id] = @c_id">
            <DeleteParameters>
                <asp:Parameter Name="c_id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="lei" Type="String" />
                <asp:Parameter Name="chejian" Type="String" />
                <asp:Parameter Name="banzu" Type="String" />
                <asp:Parameter Name="nian" Type="String" />
                <asp:Parameter Name="yue" Type="String" />
                <asp:Parameter Name="addname" Type="String" />
                <asp:Parameter Name="addtime" Type="DateTime" />
                <asp:Parameter Name="addip" Type="String" />
                <asp:Parameter Name="chejianname" Type="String" />
                <asp:Parameter Name="chejiantime" Type="DateTime" />
                <asp:Parameter Name="chejianip" Type="String" />
                <asp:Parameter Name="duanname" Type="String" />
                <asp:Parameter Name="duantime" Type="DateTime" />
                <asp:Parameter Name="duanip" Type="String" />
                <asp:Parameter Name="cailiaoname" Type="String" />
                <asp:Parameter Name="cailiaotime" Type="DateTime" />
                <asp:Parameter Name="cailiaoip" Type="String" />
                <asp:Parameter Name="lingdaoname" Type="String" />
                <asp:Parameter Name="lingdaotime" Type="DateTime" />
                <asp:Parameter Name="lingdaoip" Type="String" />
                <asp:Parameter Name="zt" Type="String" />
            </InsertParameters>
            <SelectParameters>
                <asp:QueryStringParameter Name="c_id" QueryStringField="id" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="lei" Type="String" />
                <asp:Parameter Name="chejian" Type="String" />
                <asp:Parameter Name="banzu" Type="String" />
                <asp:Parameter Name="nian" Type="String" />
                <asp:Parameter Name="yue" Type="String" />
                <asp:Parameter Name="addname" Type="String" />
                <asp:Parameter Name="addtime" Type="DateTime" />
                <asp:Parameter Name="addip" Type="String" />
                <asp:Parameter Name="chejianname" Type="String" />
                <asp:Parameter Name="chejiantime" Type="DateTime" />
                <asp:Parameter Name="chejianip" Type="String" />
                <asp:Parameter Name="duanname" Type="String" />
                <asp:Parameter Name="duantime" Type="DateTime" />
                <asp:Parameter Name="duanip" Type="String" />
                <asp:Parameter Name="cailiaoname" Type="String" />
                <asp:Parameter Name="cailiaotime" Type="DateTime" />
                <asp:Parameter Name="cailiaoip" Type="String" />
                <asp:Parameter Name="lingdaoname" Type="String" />
                <asp:Parameter Name="lingdaotime" Type="DateTime" />
                <asp:Parameter Name="lingdaoip" Type="String" />
                <asp:Parameter Name="zt" Type="String" />
                <asp:Parameter Name="c_id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="id" DataSourceID="SqlDataSource1" 
            EnableModelValidation="True" ForeColor="#333333" GridLines="None" 
            style="font-size: small; text-align: center" 
            onrowdatabound="GridView1_RowDataBound" Font-Bold="False" ShowFooter="True">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="序号"></asp:TemplateField>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="bianhao" HeaderText="物资编码" 
                    SortExpression="bianhao" />
                <asp:BoundField DataField="leibie1" HeaderText="类别" SortExpression="leibie1" />
                <asp:BoundField DataField="leibie2" HeaderText="子类别" SortExpression="leibie2" Visible="False" />
                <asp:BoundField DataField="mingcheng" HeaderText="材料物资名称" 
                    SortExpression="mingcheng" />
                <asp:BoundField DataField="guige" HeaderText="规格型号" SortExpression="guige" 
                    HtmlEncode="False" />
                <asp:BoundField DataField="danwei" HeaderText="单位" SortExpression="danwei" />
                <asp:BoundField DataField="danjia" HeaderText="目录价(元)" SortExpression="danjia" />
                <asp:BoundField DataField="banzushuliang" HeaderText="班组计划数量" 
                    SortExpression="banzushuliang" />
                <asp:BoundField DataField="chejianshuliang" HeaderText="车间审批数量" 
                    SortExpression="chejianshuliang" />
                <asp:BoundField DataField="duanshuliang" HeaderText="段审批数量" 
                    SortExpression="duanshuliang" />
                <asp:BoundField DataField="beizhu" HeaderText="备注" SortExpression="beizhu" />
                <asp:TemplateField HeaderText="发料数量" SortExpression="daohuoshuliang">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("daohuoshuliang") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("daohuoshuliang") %>' 
                            Width="30px"></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="qianren" HeaderText="发料人" 
                    SortExpression="qianren" Visible="False" />
                <asp:BoundField DataField="qianrenshijian" HeaderText="发料时间" 
                    SortExpression="qianrenshijian" Visible="False" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>" 
            
            
            SelectCommand="SELECT * FROM [cailiaomingxi] WHERE ([c_id] = @c_id and duanshuliang&gt;0 and duanshuliang&gt;daohuoshuliang) ORDER BY [bianhao]">
            <SelectParameters>
                <asp:QueryStringParameter Name="c_id" QueryStringField="id" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <span class="style8">
        <br />
        当前登录用户：<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
        <br />
        <br />
        </span>
        <span class="auto-style2">
        <span class="auto-style1">请注意：一张计划单只允许发料操作一次，请确认已审批的材料已全部发出。<br />
        <br />
        如果该计划单有未发料的材料，请在所有材料发出后再进行发料操作，以免造成发料金额统计错误！ </span>
        <br />
        </span>
        <br />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
            onclientclick="return confirm('请注意：一张计划单只允许发料一次，请确认已审批的材料已全部发出。确认继续吗？')" Text="确认材料发放" />
        <br /></b>
    </div>
    </div>
    </form>
    <p class="style21" style="TEXT-ALIGN: center">
        &nbsp;<br />
        &nbsp;安康供电段信息中心制作 2015</p>
</body>
</html>
